package View

import ControllerView.ControllerView
import com.trolltech.qt.core.{Qt, QSize}
import com.trolltech.qt.gui._

/**
 * Created by IntelliJ IDEA.
 * User: danymorard
 * Date: 14.04.11
 * Time: 21:32
 * To change this template use File | Settings | File Templates.
 */

class AboutHelpView(controller: ControllerView, parent: QWidget) extends View(controller, parent) {


  /**
   * Size of the window
   */
  protected val WINDOW_SIZE = new QSize(400, 300)


  /**
   * Background Image
   */
  protected var backgroundImage = new QLabel(this)

  this.initView


  /**
   * Initialize the view
   */
  protected def initView {


    // Center the window in the middle of the screen
/*    val screenWidget = QApplication.desktop

    this.move(screenWidget.width / 2 - WINDOW_SIZE.width / 2,
      screenWidget.height / 2 - WINDOW_SIZE.height / 2)

  */
    this.setFixedSize(WINDOW_SIZE)

    // remove frame border
    this.setWindowFlags(Qt.WindowType.FramelessWindowHint)

    // add the style sheet to the window
    this.setStyleSheet(readStyleSheet(PATH_STYLESHEET + "aboutView.css"))


    // set background iamge
    backgroundImage.setPixmap(new QPixmap(PATH_PICTURE + "HelpAboutView.jpg"))
    backgroundImage.setGeometry(0,0,WINDOW_SIZE.width,WINDOW_SIZE.height)



    this.show
  }

  override def mousePressEvent(event: QMouseEvent) {
    this.close
  }
}
